From 5473475c0e0604433a185ed4ea96cb9e09267f25 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 16 Apr 2006 15:41:31 +0100 Subject: [PATCH] Only BSP can really do clear_all_shadow_status. This fixes SMP IA32 VMX guest booting on IA32 xen. Signed-off-by: Xin Li --- xen/arch/x86/shadow32.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/shadow32.c b/xen/arch/x86/shadow32.c index 458bb99555..c8ff4f579c 100644 --- a/xen/arch/x86/shadow32.c +++ b/xen/arch/x86/shadow32.c @@ -3291,19 +3291,29 @@ void __update_pagetables(struct vcpu *v) void clear_all_shadow_status(struct domain *d) { + struct vcpu *v = current; + + /* + * Don't clean up while other vcpus are working. + */ + if ( v->vcpu_id ) + return; + shadow_lock(d); + free_shadow_pages(d); free_shadow_ht_entries(d); - d->arch.shadow_ht = + d->arch.shadow_ht = xmalloc_array(struct shadow_status, shadow_ht_buckets); if ( d->arch.shadow_ht == NULL ) { - printk("clear all shadow status:xmalloc fail\n"); + printk("clear all shadow status: xmalloc failed\n"); domain_crash_synchronous(); } memset(d->arch.shadow_ht, 0, shadow_ht_buckets * sizeof(struct shadow_status)); free_out_of_sync_entries(d); + shadow_unlock(d); } -- 2.30.2